package io.cloud.tec.project.web;

import io.cloud.tec.project.service.JdkService;
import lombok.AllArgsConstructor;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Properties;

@AllArgsConstructor
@RestController
@RequestMapping("/api/jdk")
@Slf4j
public class JdkController {

    JdkService jdkService;

    @SneakyThrows
    @GetMapping("SystemProperty")
    public Properties systemProperty() {
        return System.getProperties();
    }

    @GetMapping("downloadLink")
    public List<String> getDownloadLink() {
        return jdkService.getDownloadLink("202");
    }
}
